/*
 * @Description: 左侧菜单数据获取API
 * @Author: pinus
 * @Email: pinus0716@163.com
 * @Git: https://gitee.com/xyf97
 * @Date: 2021-10-07 19:37:07
 * @LastEditTime: 2021-10-07 20:37:25
 */

const express = require('express')
const router = express.Router()
const path = require('path')
const menuService = require(path.join(process.cwd(), '/services/MenuService'))

router.get('/', function (req, res, next) {
  menuService.getLeftMenus(req.userInfo, function (err, result) {
    // console.log(err)
    if (err) return res.sendResult(null, 400, err)

    res.sendResult(result, 200, '获取菜单列表成功')
  })
})

module.exports = router
